﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;

namespace Web.Shalo.BanPMS1.Admin
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnDangNhap_Click(object sender, EventArgs e) //btnDanhNhap_Click
        {
            NhanVienController obj = new NhanVienController();
            bool res = obj.bllKiemTraDN(txtManv.Text, txtMatkhau.Text);
            ThongBao(res);
        }
        public void ThongBao(bool res)
        {
            if (res)
            {
                
                Session["manv"] = txtManv.Text;
                Session["matkhau"] = txtMatkhau.Text;
                Response.Redirect("QuanTri.aspx");
            }
            else
            {
                Page.RegisterClientScriptBlock("mes", "<script language='javascript'>alert('Đăng Nhập Thất Bại')</script>");
            }
        }
    }
}